<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="target-densitydpi=640,width=1280,user-scalable=yes">
    <base href="<?php echo $system['siteRoot'];?>" />
    <title>普团积分</title>
    <?php import_tpl("fragment/icon.php"); ?>
    <link rel="stylesheet" href="plugin/reset.css"/>
    <link rel="stylesheet" href="plugin/awesome4/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="style/common.css"/>
    <link rel="stylesheet" href="style/credits.css"/>
    <script src="plugin/jquery-1.11.2.min.js"></script>
    <script type="text/javascript">
    (function(){
        $(function(){
            //console.log( $('.slide .commodity'))
            $('.slide .point').addClass('menu-normal').removeClass('menu-label')    
        })
    })()
    </script>
    <script type="text/javascript">_root='<?php echo $system['siteRoot'];?>'</script>
    <script src="script/api.js"></script>
    <script src="script/my-point.js"></script>
</head>
<body>
<div id="container" class="index">
    <?php import_part("custom.home","userBar"); ?>
    <?php import_part("custom.home","header"); ?>
    <?php import_tpl("fragment/nav.php"); ?>
    <div class="main-container">
        <div class="left">
            <?php import_tpl("fragment/mySlide.php"); ?>
            <div class="qr-code-box">
                <img src="images/weixin.png" alt="扫描二维码关注" title="关注我们的微信"/>
                <div>
                    <p class="weixin">扫描二维码</p>
                    <p class="concern">关注我们的微信</p>
                </div>
            </div>
        </div>
        <div class="right">
            <div class="my-credits">
                <div class="wap">
                    <p>我的积分</p>
                </div>
                <div class="present-credit">
                    <p>我的积分&nbsp;&nbsp;&nbsp;&nbsp;<span class="present-credit-amount"><?=$r['user']['point']?></span>
                        <span>&nbsp;(10分直接抵用0.01元)</span></p>
                    <p class="growth-credit">我的成长值&nbsp;&nbsp;</p>
                    <div class="growth-strip" data-growth="<?=$r['user']['growth']?>" data-limit="<?=$r['nextLv']['limit']?>">
                        <span><?=$r['user']['growth']?>/<?=$r['nextLv']['limit']?></span>
                    </div>
                </div>
            </div>
            <div class="my-pay-ticket">
                <div class="wap">
                    <p>我的支付券</p>
                </div>
                <div class="pay-ticket-detail">
                    <table>
                        <tr class="pay-ticket-attribute">
                            <td class="ticket-ID">商家</td>
                            <td class="ticket-money">金额</td>
                            <td class="ticket-date">有效期</td>
                            <td class="ticket-situation">状态</td>
                            <td class="ticket-remark">备注</td>
                        </tr>
                        <?php foreach ($r['coupon'] as $v) {?>
                            <tr class="<?=$v['used']==1?'pay-ticket-value-two':'pay-ticket-value-one'?> ?>">
                                <td class="ticket-ID"><?=$v['company']?></td>
                                <td class="ticket-money"><?=$v['coupon_value']?></td>
                                <td class="ticket-date"><?=$v['deadline']?></td>
                                <td class="ticket-situation"><?=$v['used']==1?'已使用':'未使用'?></td>
                                <td class="ticket-remark"><?=$v['remark']?></td>
                            </tr>
                        <?php }?>

                    </table>
                </div>
            </div>
            <div class="credit-detail">
                <div class="wap">
                    <p>积分流水明细</p>
                </div>
                <div class="credit-Details">
                    <table>
                        <tr class="credit-attribute">
                            <td class="growth-value">成长值</td>
                            <td class="credit-amount">积分</td>
                            <td class="credit-total">积分累计</td>
                            <td class="credit-date">日期</td>
                            <td class="credit-remark">备注</td>
                        </tr>
                        <?php foreach ($r['growth'] as $v) {?>
                        <tr>
                            <td class="growth-value"><?=$v['growth']?></td>
                            <td class="credit-amount"><?=$v['point']?></td>
                            <td class="credit-total"><?=(int)$v['total']?></td>
                            <td class="credit-date"><?=$v['date']?></td>
                            <td class="credit-remark"><?=$v['remark']?></td>
                         </tr>
                        <?php }?>
                    </table>
                </div>
            </div>
            <?php if($r['page'] instanceof Page && !$r['pageEmpty']){
                $page=$r['page'];?>
                <div class="turn-page">
                    <?php if($page->ifPrev()) { ?>
                        <a href="<?=$page->getPageUrl($page->getPrev());?>"><i class="fa fa-chevron-left"></i>上一页</a>
                    <?php }?>
                    <?php foreach($page->getPageArray() as $i){ ?>
                        <a href="<?=$page->getPageUrl($i);?>"><?php echo $i;?></a>
                    <?php } ?>
                    <?php if($page->ifNext()) { ?>
                        <a href="<?=$page->getPageUrl($page->getNext());?>">下一页<i class="fa fa-chevron-right"></i></a>
                    <?php }?>
                </div>
            <?php } ?>
        </div>
    </div>
    <?php import_tpl("fragment/footer.php"); ?>
</div>
</body>
</html>